package cn.edu.cqu.bysj.wm.gui;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JLabel;

public class BYSJFileTree extends SystemFileTree {
	
	JLabel filePathLabel = null;
	JButton button;

	/**
	 * creat file tree
	 * 
	 * @param filePath
	 * @param label
	 * @param jButton
	 */
	public BYSJFileTree(String filePath, JLabel label, JButton jButton) {

		super(filePath);
		this.filePathLabel = label;
		this.button = jButton;
		tree.addMouseListener(new MouseAdapter() {
			public void mousePressed(MouseEvent e) {
				filePathLabel.setText(selectedFilePath);
				button.doClick();
			}
		});
	}

	public BYSJFileTree() {
		// TODO Auto-generated constructor stub
	}

	public void setEnable(boolean isEnable) {
		this.tree.setEnabled(isEnable);
	}
}
